<link rel="stylesheet" href="../../css/base.css">
<link rel="stylesheet" href="../../css/detailPanel/detailPanel.css">
<link rel="stylesheet" href="../../css/Aj-progress.css">
<div class="rightComeToL">
  <div class="detailPanel">
    <!--任务详情头部 starl-->
    <div class="panelTitle">
      <div class="clearfix">
        <div class="fl panelCHeckbox">
         <span ng-class="{'panelCHeckboxSpan':tempDetail.task.status==1}" ng-click="detailThrothTheP($event,tempDetail.task.id,tempDetail.task.status)" ng-hide="tempDetail.taskType==2"> <i class="iconfont" ></i></span>
          <!--<input type="checkbox" ng-click="detailThrothTheP($event,tempDetail.task.id)" ng-hide="tempDetail.taskType==2"ng-checked="tempDetail.task.status==1">-->
        </div>
        <div class="fl panelText">
          <h3 ng-hide="editTaskCase" ng-class={strickout:tempDetail.task.status==1}>{{tempDetail.task.title}}</h3>
          <input auto-focus-much="editTaskCase" class="panelTextAdd"  type="text" value="接到咨询整理相关文件" ng-hide="!editTaskCase" ng-model="tempDetail.task.title" ng-blur="updateDes()" maxlength="15">
          <p>{{tempDetail.task.caseInfo.casename||tempDetail.task.evidenceTask.caseInfo.casename}}</p>
        </div>
        <div class="fr panelTitleLast">
          <ul class="clearfix">
            <li class="fl d-canClick w_attachmentBtn" style="position: relative;">
              <form class=" pull-left">
                <i class="icon iconfont" style="cursor:pointer;">&#xe67d;</i>
                <input class="d-appendix-input" ng-disabled="typeIf==7" type="file" style="font-size: 0;" />
              </form>
              <span class="w_attachment_icon"></span>
              <span class="w_attachment_text">添加附件</span>
            </li>
            <li class="fl d-canClick">
              <i class="icon iconfont" ng-click="DetailEditToggle()">&#xe682;</i>
              <div class="operationMenu" ng-hide="!detailEditToggle" style="z-index:99">
                <div class="operationMenuTitle">
                  <p>操作菜单</p>
                  <i class="icon iconfont" ng-click="detailEditToggle=false">&#xe674;</i>
                </div>
                <ul class="operationMenuContent">
                  <li ng-click="EditTaskCase()">
                    <i class="icon iconfont">&#xe680;</i>
                    <span>编辑任务</span>
                  </li>
                  <li ng-click="jcdeleteupdateNameConfirm($event)">
                    <i class="icon iconfont">&#xe681;</i>
                    <span>删除</span>
                  </li>
                </ul>
              </div>
            </li>
            <li class="fl d-canClick" ng-click="EditTaskParticularsClose()">
              <i class="icon iconfont">&#xe683;</i>
            </li>
          </ul>
        </div>
      </div>
      <!--证据-->

      <div class="panelTitleEvidence" ng-show="tempDetail.taskType==2"><!---->
        <div class="fl evidenceBu">
          分类：
          <div ng-click="caseGroupListToggle()" >{{caseGroupListConversion}}
          <ul ng-show="getCaseGroupList">
            <li ng-repeat="text in EGroupList" ng-click="updateDes(null,$index,$event)" ng-show="text.evidenceGroupName!='全部证据'">{{text.evidenceGroupName}}</li>
          </ul>
        </div>
        </div>

        <div class="fl evidenceButton">
          证据类型：
          <div ng-click="caseProofListToggle()" >{{caseProofListConversion}}
            <ul ng-show="getCaseProofList">
              <li ng-repeat="text in ETypeList" ng-click="updateDes($index,null,$event)">{{text.evidenceTypeName}}</li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <!--任务详情头部 end-->
    <!--任务描述 start-->
    <div class="panelTask">
      <!--初始状态以及完成状态-->
      <div>
        <div class="panelTaskTop d-canClick" ng-click="EditCaseDescribe()" ng-show="!editTaskState">
          <i class="icon iconfont">&#xe689;</i>
          <span>{{tempDetail.task.content==undefined?'在此输入任务描述....':'任务描述'}}</span>
        </div>
        <div class="panelTaskBottom d-canClick" ng-show="tempDetail.task.content!=undefined&&!editTaskState" ng-click="EditCaseDescribeTwo()">
          <p >
            {{tempDetail.task.content}}
          </p>
        </div>
      </div>
      <!--编辑状态-->
      <div ng-show="editTaskState">
        <div class="panelTaskTop">
          <i class="icon iconfont">&#xe689;</i>
          <span>任务描述</span>
        </div>
        <div class="panelTaskBottom clearfix" style="padding: 15px">
          <textarea name="" id="" cols="" rows="10" maxlength="200" ng-model="tempDetail.task.content" auto-focus-much="editTaskState"></textarea>
          <div class="fr">
            <button type="button" class="determine" ng-click="updateDes()">确定</button>
            <button type="button" class="cancel" ng-click="EditTaskStateClose()">取消</button>
          </div>
        </div>
      </div>
    </div>
    <!--任务描述 end-->
    <!--工时 start-->
    <div class="panelTime">
      <div class="panelTimeTop">
      <span>
        <p>
          预计工时：
          <input type="text" maxlength="3" auto-focus-much="editTaskEstimateHour"  placeholder="{{tempDetail.task.estimateHour||0}}" ng-model="tempDetail.task.estimateHour"  placeholder={{tempDetail.task.estimateHour}} ng-show="editTaskEstimateHour" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" ng-blur="updateDes()">
          <span class="d-canClick" ng-click="EditTaskEstimateHour($event)" ng-show="!editTaskEstimateHour">{{tempDetail.task.estimateHour||0}}</span>
          h
        </p>
      </span>
      <span>
        <p>
          实际工时：
          <input type="text" maxlength="3"  auto-focus-much="editTaskActualHour"  placeholder="{{tempDetail.task.actualHour||0}}" ng-model="tempDetail.task.actualHour"  ng-show="editTaskActualHour" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')" ng-blur="updateDes()">
          <span class="d-canClick" ng-click="EditTaskActualHour($event)" ng-show="!editTaskActualHour">{{tempDetail.task.actualHour||0}}</span>
          h
        </p>
      </span>
      </div>
      <div>
      <span class="deadlineDatePicker">
        <p class="editTaskDeadline_{{detailTaskId}}" style="width:100%;">
          截止日期：<span id="taskDeadline">{{tempDetail.task.deadline}}<img  class="d-lawyer-close" src="img/lawyer-close.png" alt="" ng-show="tempDetail.task.deadline!=null" ng-click="deleteTaskDeadLine(tempDetail.task,$event)"></span>
        </p>
      </span>
      </div>
    </div>
    <!--工时 end-->
    <!--检查项 start-->
    <div class="panelCheckItem">
      <div class="panelCheckItemTop d-canClick" ng-click="!tempDetail.caseTaskCheckList.length?EditCheckItem():''">
      <span>
        <i class="icon iconfont">{{!editCheckItemToggle&&!tempDetail.caseTaskCheckList.length?'&#xe684;':'&#xe698;'}}</i>
      </span>
        <p>{{!editCheckItemToggle&&!tempDetail.caseTaskCheckList.length?'添加检查项':'检查项'}}</p><!--ng-show="!editCheckItemToggle"-->
        <!--<input type="text" class="panelCheckItemEdit" auto-focus-much="editCheckItemToggle" ng-show="editCheckItemToggle" ng-model="taskCheck.checkname" ng-blur="saveTaskCheckedItem($event)" ng-enter="saveTaskCheckedItem($event)">-->
        <!--<i style='color:red;font-size: 12px;' ng-show="editCheckItemHint">检查项内容不能为空</i>-->
      </div>
      <ul class="panelCheckItemBottom" >
        <li ng-repeat="caseTaskCheckList in tempDetail.caseTaskCheckList" ng-show="tempDetail.caseTaskCheckList.length" ng-click="EditTaskCheckName(caseTaskCheckList)">
          <div class="clearfix" ng-show="!caseTaskCheckList.editTaskCheckName">
            <span class="fl" type="checkbox" ng-class="{'panelCHeckboxSpan':caseTaskCheckList.status==5}" ng-click="changeCheckListStatus(caseTaskCheckList,$event)"> <i class="iconfont" ></i></span>
            <p class="fl" ng-class={strickout:caseTaskCheckList.status==5}>
              {{caseTaskCheckList.checkname}}
            </p>
            <i class="icon iconfont d-icon-block fr" ng-click="delCheckItem($index,caseTaskCheckList,$event)">&#xe681;</i>
          </div>
          <div class="clearfix" ng-show="caseTaskCheckList.editTaskCheckName">
            <div class="d-panelCheckItemEdit">
              <div>
                <span></span>
                <textarea name="" id="" cols="" rows="2"  auto-focus-much="caseTaskCheckList.editTaskCheckName" ng-model="caseTaskCheckList.checkname"  maxlength="25">

            </textarea>
              </div>
              <p style="display: block; margin-right:0;padding-right:19px;">
                <button class="w_btn w_conserve" ng-click="updateTaskCheckedItem(caseTaskCheckList,$event)">确定</button>
                <button class="w_btn w_cancel" ng-click="updateTaskCheckedItemClose(caseTaskCheckList,$event)">取消</button>
              </p>
            </div>
            <!--<input class="addItem" type="text" ng-model="caseTaskCheckList.checkname" ng-blur="updateTaskCheckedItem(caseTaskCheckList)">-->
          </div>
        </li>
      </ul>
      <div class="d-panelCheckItemEdit" ng-show="editCheckItemToggle">
          <div>
            <span></span>
            <textarea name="" id="" cols="" rows="2"  auto-focus-much="editCheckItemToggle" ng-model="taskCheck.checkname" >

            </textarea>
            <i style='color:red;font-size: 12px;float:left;width:140px;margin-top:4px;' ng-show="editCheckItemHint">检查项内容不能为空</i>
          </div>
          <p>
            <button class="w_btn w_conserve" ng-click="saveTaskCheckedItem($event)">确定</button>
            <button class="w_btn w_cancel" ng-click="EditCheckItemClose()">取消</button>
          </p>
      </div>
      <div class="panelCheckItemTop d-canClick" ng-click="EditCheckItem()" ng-show="tempDetail.caseTaskCheckList.length" >
      <span style="border:0;">
        <i class="icon iconfont">&#xe684;</i>
      </span>
        <p>添加检查项</p>

      </div>
    </div>
    <!--检查项 end-->
    <!--分配任务 start-->
    <div class="panelAssignment" ng-show="taskType==1">
      <div class="panelAssignmentTop">
        分配任务给：
      </div>
      <div class="panelAssignmentBottom">
        <ul class="clearfix">
          <li ng-repeat="img in tempDetail.taskExecutors" style="position: relative;" class="d-executor-delete">
            <img  width="40" height="40" src="{{img.executor.iconUrl}}" alt="头像">
            <img  style="position: absolute;right:-4px;top:-3px;" ng-click="deleteTaskLaywer(img.id,img.executiveid,img.executor.username,$index,$event)"
                 class="executor-delete" src="img/lawyer-close.png" alt="" ng-show="typeIf!=7">
          </li>


          <li id="d-addLastLawyer" class="addLast" ng-click="EditAddPeopleBox()">
            <i class="icon iconfont">&#xe67f;</i>
            <div id="d-addLastLawyerSon" class="addLastDropdown" ng-show="editAddPeopleToggle" style="z-index: 99">
              <div class="addLastDropdownTitle">
                <p>请选择添加成员</p>
                <i class="icon iconfont" ng-click="EditAddPeopleClose($event)">&#xe674;</i>
              </div>
              <ul class="addLastDropdownList clearfix wt-scroll" ng-show="lawyersList.length!= 0">
                <li class="clearfix" ng-repeat="lawyer in lawyersList">
                  <span class="fl">{{lawyer.lawyer.username}}</span>
                  <button class="fr" type="button" ng-click="addTaskLawyer($index,lawyer.lawyerid,lawyer.lawyer.username,$event)">添加</button>
                </li>
              </ul>
              <div ng-show="lawyersList.length == 0">
                <ul align="center" style="margin:0;"><b>已添加全部成员</b></ul>
              </div>
            </div>
          </li>
        </ul>
      </div>
    </div>
    <!--分配任务 end-->
    <!--附件 start-->
    <div class="panelEnclosure" ng-show="tempDetail.caseTaskAttses.length">
      <div class="panelEnclosureTop" style="position: relative;">
      <span>
       <i class="icon iconfont">&#xe684;</i>
      </span>
        <p>附件</p>
        <input class="d-appendix-input" type="file" style="width:100%;height:100%;" ng-disabled="typeIf==7"/>
      </div>
      <div class="panelEnclosureBottom" >
        <ul class="panelEnclosureBottomInner">
          <li class="clearfix" ng-repeat="file in tempDetail.caseTaskAttses">
            <div class="fl enclosureImg">
              <p id="L_layout_{{ShowFileSuffix(file.fileName||file.name)}}"  style="width: 53px;height: 53px;"></p>
              <!--<img width="50" height="50" src="{{file.filePath}}" alt="">-->
            </div>
            <div class="fl enclosureText">
              <h6>{{file.fileName||file.name}}</h6>
              <p>{{file.fileSize}}KB</p>
            </div>
            <div class="fr enclosureList">
              <ul class="clearfix">
                <li class="fl" ng-click="TaskPreviewAttach(file)">
                  <p>
                    <i class="icon iconfont">&#xe688;</i>
                  </p>
                  <p class="enNone">预览</p>
                </li>
                <li class="fl" ng-click="DownloadFileProgress(file)">
                  <p>
                    <i class="icon iconfont">&#xe687;</i>
                  </p>
                  <p class="enNone">下载</p>
                </li>
                <li class="fl" ng-click="tempDetail.taskType==1?DeleteTaskAppendix(file.id,file.fileName,file.creatUserId,$index):deleteProofFile(file.id,file.name)">
                  <p>
                    <i class="icon iconfont">&#xe681;</i>
                  </p>
                  <p class="enNone" >删除</p>
                </li>
              </ul>
            </div>
          </li>
        </ul>
      </div>
    </div>
    <!--附件 end-->
    <!--分隔线 start-->
    <div class="dividingLine clearfix">
      <p class="fr">{{tempDetail.task.createddate || tempDetail.task.createdDate}} 由  {{tempDetail.task.creator.username || tempDetail.task.biglawuser.username}}  创建</p>
    </div>
    <!--分隔线 end-->
    <!--评论日志 start-->
    <div class="panelComment">
      <div class="panelCommentTop">
        <span ng-class={active:!sendCommentTab} ng-click="sendComment(1)">评论</span>
        <span ng-class={active:sendCommentTab} ng-click="sendComment(2)">任务日志</span>
      </div>
      <!--评论-->
      <div class="panelCommentTask" ng-show="!sendCommentTab">
        <div ng-repeat="pl in tempDetail.caseTaskReviews">
          <p class="time">{{pl.createdDate}}</p>
          <div class="clearfix taskImgOuter">
            <div class="fl panelCommentTaskImg tc" style="overflow: hidden;">
              <img ng-show="pl.commentator.iconUrl!=null||pl.biglawuser.iconUrl!=null" width="28" height="28" ng-src="{{pl.commentator.iconUrl||pl.biglawuser.iconUrl}}" alt="">
              <div ng-show="pl.commentator.iconUrl!=null||pl.biglawuser.iconUrl!=null" class="shortDiv"
                   style="color:lightslategray;width: 40px;height: 40px;text-align: center;line-height: 40px;background-color: #00BB9C;font-size: 12px;border-radius: 50%;">
                {{pl.commentator.username||pl.biglawuser.username}}
              </div>
              <p >{{pl.commentator.username||pl.biglawuser.username}}</p>
            </div>
            <div class="fl taskImgContent">
              {{pl.context||pl.comment}}
            </div>
          </div>
          <div ng-show="tempDetail.caseTaskReviews==null || tempDetail.caseTaskReviews==undefined || tempDetail.caseTaskReviews=='' || tempDetail.caseTaskReviews==[] ">
            <p style="color: #ccc;text-align: center;margin-top: 30px">暂无任何评论</p>
          </div>
        </div>
      </div >
      <!--任务日志-->
      <div class="panelJournalTask" ng-show="sendCommentTab">
        <div class="clearfix"ng-repeat="log in tempDetail.taskLogs">
          <div class="fl commentTaskTime" >
            <p>{{log.createdDate}}</p>
          </div>
          <div class="fl commentTaskText" >
            <p>{{log.creator.username||log.biglawuser.username}} {{log.content}} </p>
          </div>
        </div>
      </div>
    </div>
    <!--评论日志 end-->
    <!--写评论区 start-->
    <div class="addComment" ng-show="typeIf!=7">
      <input type="text" class="addComText" ng-model="commentInput" placeholder="评论点什么（按Enter键提交）" ng-enter="editTaskSendComment(commentInput)">
      <button type="button" ng-click="editTaskSendComment(commentInput)">发送</button>
    </div>
    <!--写评论区 end-->
  </div>
</div>
<script>
  $('.rightComeToL').click(function(ev){
    var ev=ev||event;
    if(ev.stopPropagation){
      ev.stopPropagation();
    }
    else{
      ev.cancelBubble=true;
    }
  });
</script>


















